package org.com.gamemall.Controller;

import dev.langchain4j.model.chat.ChatModel;
import lombok.extern.slf4j.Slf4j;
import org.com.gamemall.Service.ChatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/ai")
public class ChatController {
    @Autowired
    private ChatService chatService;
    @GetMapping("/chat")
    public String chat(String message) {
        log.info("用户提问: {}", message);
        return chatService.chat(message);
    }
}
